﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartSharp
{
    public class Colors : ChartParam
    {
        protected IEnumerable<string> _colors; 

        public override string Name
        {
            get { return "chco"; }
        }

        public override string Data
        {
            get
            {
                StringBuilder builder = new StringBuilder();

                _colors.ToList().ForEach((color) =>
                {
                    builder.Append(color);
                    builder.Append(",");
                });

                if (builder.Length > 0)
                {
                    builder.Length--;
                }

                return builder.ToString();
            }
        }

        public Colors(string color)
        {
            _colors = new string[] { color };
        }

        public Colors(IEnumerable<string> colors)
        {
            _colors = colors;
        }
    }
}
